import request from '@/utils/request'
//获取资源列表
export function getResoList (data) {
  return request({
    url: '/reso/list',
    method: 'post',
    data
  })
}
//其他页面获取全部的资源
export function getReso (params) {
  return request({
    url: '/reso/getReso',
    method: 'get',
    params
  })
}
//根据id删除资源
export function deleteResoById (id) {
  return request({
    url: '/reso/deleteById',
    method: 'get',
    params: { id }
  })
}
//新增资源
export function addReso (data) {
  return request({
    url: '/reso/addReso',
    method: 'post',
    data
  })
}
//更新资源
export function updateReso (data) {
  return request({
    url: '/reso/updateReso',
    method: 'post',
    data
  })
}

//查询 Url 是否被占用
export function checkUrl (params) {
  return request({
    url: '/reso/checkUrl',
    method: 'get',
    params
  })
}
//查询 Api 是否被占用
export function checkApi (params) {
  return request({
    url: '/reso/checkApi',
    method: 'get',
    params
  })
}
//查询 Code 是否被占用
export function checkCode (params) {
  return request({
    url: '/reso/checkCode',
    method: 'get',
    params
  })
}
//查询对应资源是否存在是否被占用
export function exist (params) {
  return request({
    url: '/reso/exist',
    method: 'get',
    params
  })
}